package Date;

import java.text.ParseException;
import java.text.SimpleDateFormat;
import java.util.Date;

public class Test1 {
    public static void main(String[] args) throws ParseException {
        String s = "2023-11-11 0:01:18";
        String end = "2023-11-11 00:10:18";

        String xy = "2023-11-11 00:06:48";
        String xq = "2023-11-11 00:010:48";

        SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");

        Date ss = sdf.parse(s);
        Date es = sdf.parse(end);
        Date yxs= sdf.parse(xy);
        Date wxs = sdf.parse(xq);

        if (yxs.after( ss)  && yxs.before(es)){
            System.out.println("秒杀成功");
        }else {
            System.out.println("秒杀失败");
        }
        if (wxs.after( ss)&& wxs.before(es)){
            System.out.println("666");
        }else {
            System.out.println("没抢到");
        }

    }
}
